﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AKMII.DMRA.Common
{
    public static class Comparer
    {
        /*
        public static int CompareLeadsByTerritory(Lead x, Lead y)
        {
            if (x == null)
            {
                if (y == null)
                {
                    // If x is null and y is null, they're
                    // equal. 
                    return 0;
                }
                else
                {
                    // If x is null and y is not null, y
                    // is greater. 
                    return -1;
                }
            }
            else
            {
                // If x is not null...
                //
                if (y == null)
                // ...and y is null, x is greater.
                {
                    return 1;
                }
                else
                {
                    // ...and y is not null, compare the Territory property of two objects
                    //
                    return x.Territory.CompareTo(y.Territory);
                }
            }
        }

        public static int CompareLeadsByNameASC(Lead x, Lead y)
        {
            if (x == null)
            {
                if (y == null)
                {
                    // If x is null and y is null, they're
                    // equal. 
                    return 0;
                }
                else
                {
                    // If x is null and y is not null, y
                    // is greater. 
                    return -1;
                }
            }
            else
            {
                // If x is not null...
                //
                if (y == null)
                // ...and y is null, x is greater.
                {
                    return 1;
                }
                else
                {
                    // ...and y is not null, compare the Name property of two objects
                    //
                    int result = x.SubSequenceNumber.CompareTo(y.SubSequenceNumber);
                    if (result < 0)
                        return 1;
                    else if (result > 0)
                        return -1;
                    else
                        return result;
                }
            }
        }
        */
    }
}
